﻿<style>
    .xm-select-linkage .xm-select-linkage-group li {
        height:24px;
        line-height:24px
    }
    .xm-select-linkage .xm-select-linkage-group li span{
       line-height:24px
    }
</style>
<!--<div class="layui-fluid">
    <div class="layui-card">  
        当前选中<span style="color:red" id="goodnum"></span>个商品
        <br /><span style="color:green">注：审核通过后进入商品池，店铺可在商品池中选品。(商品池只显示上架状态的商品，下架状态商品不显示)<span style="color:red"></span></span>
        <div class='layui-form-item'>
            <label class="layui-form-label">审核结果</label>
            <div class='layui-input-inline'>
                <select id="auditresult" name="auditresult">
                    <option value="1">通过</option>
                    <option value="2">不通过</option>
                </select>
            </div>
            <label class="layui-form-label"></label>
            <div class='layui-input-inline'>
                <button class="layui-btn layuiadmin-btn-list" data-type="confirm">提交选品</button>
            </div>
        </div>
    </div>
    <div>
        <div id="res" style="color:green"></div>
    </div>
</div>-->
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
    <div class='layui-form-item'>
        当前选中<span style="color:red" id="goodnum"></span>个商品
        <br /><span style="color:green">注：审核通过后进入商品池，店铺可在商品池中选品。(商品池只显示上架状态的商品，下架状态商品不显示)<span style="color:red"></span></span>
    </div>
    <div class='layui-form-item'>
        <label class="layui-form-label">审核结果</label>
        <div class='layui-input-inline'>
            <select id="auditresult" name="auditresult">
                <option value="1">通过</option>
                <option value="2">不通过</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <button class="layui-btn layuiadmin-btn-list" data-type="confirm">确定审核</button>
        </div>
    </div>
</div>
<script>
     
    var form, admin, $;

    layui.use(['form', 'admin', 'table'], function () {
        var $ = layui.$
        , admin = layui.admin
        , view = layui.view 
        , form = layui.form;
        var table = layui.table;
         
        $("#goodnum").text(checkids.length);

        var active = {
            confirm: function () { 
                if (checkids.length === 0) {
                    return layer.msg('请选择商品');
                }
                var auditresult = $("#auditresult").val();
                var ids = JSON.stringify(checkids);
                var index = layer.load(1); 
                admin.req({
                    url: layui.setter.APIUrl + '/shop/goods_baseMgr/GoodAudit' //实际使用请改成服务端真实接口
                  , data: { "ids": ids, "state": auditresult }
                  , type: "post"
                  , done: function (res) {
                      layer.close(index); //执行关闭
                      layui.table.reload('LAY-app-content-list'); //重载表格
                      alert('审核成功');
                      layer.closeAll();
                  }
                });
            },
        };

        $('.layui-btn.layuiadmin-btn-list').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    });
</script>
